﻿
$(document).ready(function() {
    var rsGet;
    var tUrl = document.URL;
    var tArr = tUrl.split("/");
    var rootUrl = "";
    for (var i = 0; i < tArr.length - 2; i++) {
        rootUrl += tArr[i] + "/";
    }
    var link = rootUrl + "AjaxPages/AjaxGetXMLSubject.aspx/GetXMLSubjects"
    $.ajax({
        type: "POST",
        url: link,
        data: "{}",
        async: false,
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function(string) {
            //Success thi lam j o day
            var rs = string.d;
            //alert(rs);
            rsGet = $.parseJSON(rs);
            //alert("Co " + rsGet.length + " thoi khoa bieu!");
        },
        error: function() {
            //Loi thi lam gi
            alert("Loi roi em oi.");
        }
    });
    alert(rsGet.length);

});